{extend name="public/layer_base" /}
{block name='content'}

<div class="layui-fluid x-admin-sm">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">

                        <div class="layui-inline layui-show-xs-block">
                            <input readonly value="{$month ?? '' ;}"
                                   name="month" id="month"  class="layui-input" placeholder="日志月份">
                                   <script>
                                    laydate.render({
                                        elem: '#month'
                                        ,type: 'month'
                                    });
                                </script>
                        </div>

                        <div class="layui-inline layui-show-xs-block">
                            <input value="{$_keywords ? $_keywords : '' ;}" name="_keywords" id="_keywords"
                                class="layui-input" placeholder="操作/URL/IP">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <select name="admin_user_id" id="admin_user_id" >
                                <option value="">选择用户</option>
                                {foreach name='admin_user_list' id='item'}
                                <option value="{$item.id}"
                                        {if isset($admin_user_id)&& $admin_user_id==$item.id}selected{/if}
                                >
                                    {$item.nickname}[{$item.username}]
                                </option>
                                {/foreach}
                            </select>
                         
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input readonly value="{$create_time ?? '' ;}"
                                   name="create_time" id="create_time"  class="layui-input" placeholder="操作日期">
                                   <script>
                                    laydate.render({
                                        elem: '#create_time'
                                        ,range: true
                                        ,type:'datetime'
                                    });
                                </script>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i> 查询</button>
                            <button class="layui-btn  layui-btn-primary" onclick="clearSearchForm()" type="reset"><i class="layui-icon layui-icon-delete"></i>清空查询</button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户</th>
                                <th>操作</th>
                                <th>URL</th>
                                <th>请求方式</th>
                                <th>IP</th>
                                <th>日期</th>
                                <th>操作</th>
                            </tr>

                        </thead>
                        {foreach name='data' id='item'}
                        <tr>
                            <td>{$item.id}</td>
                            <td>{$item->adminUser->nickname}</td>
                            <td>{$item.name}</td>
                            <td>{$item.url}</td>
                            <td>{$item.method}</td>
                            <td>{$item.ip}</td>
                            <td>{$item.create_time}</td>
                            <td class="td-do">
                                <a data-id="{$item.id}" data-url="{:url('view')}" data-confirm="2" data-type="2" data-width="80%" data-height="80%"
                                   class="btn btn-default btn-xs AjaxButton" data-title="日志详情" title="查看详情" data-toggle="tooltip">
                                    <i class="fa fa-eye"></i>
                                </a>
                            </td>
                        </tr>
                        {/foreach}
                    </table>

                </div>
                <div class="layui-card-body ">
                    <div id="laypage">
                            共{$total}条
                            <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">
                            <span class="layui-laypage-limits">
                                <select lay-ignore="" onchange="changePerPage(this)">
                                    <option value="10" {if $admin.per_page==10}selected{/if}>10 条/页</option>
                                    <option value="30"  {if $admin.per_page==30}selected{/if}>30 条/页</option>
                                    <option value="50"  {if $admin.per_page==50}selected{/if}>50 条/页</option>
                                    <option value="100"  {if $admin.per_page==100}selected{/if}>100 条/页</option>
                                </select>
                            </span>
                            {$page|raw}
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>
    {/block}